from django.shortcuts import render
from django.http import HttpResponse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from ceshi import models
# Create your views here.
def index(requests):
    return render(requests,"ceshi.html",locals())
def search(requests):
    return HttpResponse("oks")
def search1(requests):
    return HttpResponse("oks1111")
def fenye(requests):
    obj = models.B.objects.all()
    if not requests.GET.get("page"):
        page = 1
    else:
        page = requests.GET.get("page")
    paginator = Paginator(obj,2)
    contacts = paginator.page(page)
    return render(request,"fenye.html",{"contacts":contacts})


def Testtubiao(request):
    return render(request,"test.html")